package com.xiaoq.matrix.repository.impl;

import org.mongodb.morphia.Datastore;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.xiaoq.coms.util.IdGeneratorUtils;
import com.xiaoq.matrix.entity.TourismMeetingEntity;
import com.xiaoq.matrix.repository.ITourismMeetingRepository;

@Repository
public class TourismMeetingRepositoryImpl implements ITourismMeetingRepository{
	
	@Autowired
	private Datastore dataStore;
	
	private static final Logger LOG = LoggerFactory.getLogger(TourismContentRepositoryImpl.class);
	
	public TourismMeetingEntity save (TourismMeetingEntity tourismMeeting){
		LOG.info("添加的会议"+tourismMeeting.toString());
		dataStore.save(tourismMeeting);
		return tourismMeeting;
		
	}

	@Override
	public TourismMeetingEntity findById(String id) {
		return dataStore.find(TourismMeetingEntity.class).field(IdGeneratorUtils.IDGENERATOR).equal(id).get();
	}

}
